﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class test_calendar : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Calendar1.Visible = false;
        Calendar2.Visible = false;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Calendar1.Visible = true;
    }
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        TextBox1.Text=Calendar1.SelectedDate.ToString();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Calendar2.Visible = true;
    }
    protected void Calendar2_SelectionChanged(object sender, EventArgs e)
    {
        TextBox2.Text = Calendar2.SelectedDate.ToString();
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        DateTime startTime = Convert.ToDateTime(Calendar1.SelectedDate);
        DateTime endTime = Convert.ToDateTime(Calendar2.SelectedDate);
        TimeSpan ts = endTime - startTime;
        Label1.Text = ts.Days.ToString();
    }
    protected void Button4_Click(object sender, EventArgs e)
    {

    }
}